﻿using AutoMapper;
using TMS_Master.Dto;
using TMS_Master.Entities;

namespace TMS_Master
{
    public class TMS_MasterApplicationAutoMapperProfile : Profile
    {
        public TMS_MasterApplicationAutoMapperProfile()
        {
            /* You can configure your AutoMapper mapping configuration here.
             * Alternatively, you can split your mapping configurations
             * into multiple profile classes for a better organization. */
            //登录
            CreateMap<UserInfo, UserInfoDto>();
            CreateMap<UserInfoDto, UserInfo>();

            //Cargo_Information 实体类  Cargo_InformationDto 实体类Dto
            //Cargo_InformationUpdateDto 验证Dto Cargo_InformationCreateDto 类添加
            #region 物资采购
            CreateMap<Cargo_Information, Cargo_InformationDto>();
            //添加修改
            CreateMap<Cargo_InformationUpdateDto, Cargo_Information>();
            //地址
            CreateMap<Address, CargoDto>();
            CreateMap<Cargo_InformationUpdateDto, Address>();
            //材质
            CreateMap<Texture, CargoDto>();
            CreateMap<Cargo_InformationUpdateDto, Texture>();
            //分类
            CreateMap<TmsTypeDto, CargoDto>();
            CreateMap<Cargo_InformationUpdateDto, TmsTypeDto>();
            #endregion

            #region 物资统计
            CreateMap<Statistical_Goods, Statistical_GoodsDto>();
            CreateMap<Statistical_GoodsUpdateDto, Statistical_Goods>();
            //地址
            CreateMap<Address, StatisticalDto>();
            CreateMap<Statistical_GoodsUpdateDto, Address>();
            //材质
            CreateMap<Texture, StatisticalDto>();
            CreateMap<Statistical_GoodsUpdateDto, Texture>();
            //分类
            CreateMap<TmsTypeDto, StatisticalDto>();
            CreateMap<Statistical_GoodsUpdateDto, TmsTypeDto>();
            #endregion

            #region 物资入库
            CreateMap<Materials_Company, Materials_CompanyDto>();
            CreateMap<Materials_CompanyUpdateDto, Materials_Company>();
            //地址
            CreateMap<Address, MaterialsDto>();
            CreateMap<Materials_CompanyUpdateDto, Address>();
            //材质
            CreateMap<Texture, MaterialsDto>();
            CreateMap<Materials_CompanyUpdateDto, Texture>();
            //分类
            CreateMap<TmsTypeDto, MaterialsDto>();
            CreateMap<Materials_CompanyUpdateDto, TmsTypeDto>();
            #endregion

            #region 物资领用
            CreateMap<Goods_Receiving, Goods_ReceivingDto>();
            CreateMap<Goods_ReceivingUpdateDto, Goods_Receiving>();
            #endregion

            #region 用户付费
            CreateMap<Paying_User, Paying_UserDto>();
            CreateMap<Paying_UserUpdateDto, Paying_User>();
            #endregion

            #region 用户收费
            CreateMap<Collect_Fee, Collect_FeeDto>();
            CreateMap<Collect_FeeUpdateDto, Collect_Fee>();
            #endregion

            #region 材质表
            CreateMap<Texture, TextureDto>();
            CreateMap<TextureDto, Texture>();
            #endregion

            #region 货物分类
            CreateMap<TmsType, TmsTypeDto>();
            CreateMap<TmsTypeDto, TmsType>();
            #endregion

            #region 地址表
            CreateMap<Address, AddressDto>();
            CreateMap<AddressDto, Address>();
            #endregion
        }
    }
}
